﻿using System.Windows.Controls;
using System.Windows.Controls.Ribbon;
using System.Windows.Input;
using AIPASoft.Interfaces;
using AIPASoft.Interfaces.Base;
using AIPASoft.Interfaces.BusinessDomain;

using AIPASoft.SecurityLibrary.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using AIPASoft.Interfaces.Security; 
using AIPASoft.SecurityLibrary.Model;

namespace AIPASoft.SecurityLibrary
{
    public class SecurityLibrary : ISecurityLibrary,IPlugin
    { 
        public SecurityLibrary()
        { 
            Name = "SecurityLibrary";
        } 
        public ILogProvider Logger { get; set; }

        private IApplicationManager ApplicationManager { get; set; }

        public List<RibbonApplicationMenuItem> GetMenuItems()
        {
            var mnuItemManage = new MenuItemManage(ApplicationManager, this);
            return mnuItemManage.RibbonMenuItems;
        }
         
          
        //Window _loginWindow;
        //LoginWindow _loginUserControl;

        //private IUserRealm ShowLoginDialog(object parentWindow=null)
        //{
        //    _loginWindow = new Window
        //        {
        //            WindowStyle = WindowStyle.SingleBorderWindow,
        //            WindowStartupLocation = WindowStartupLocation.CenterScreen,
        //            Title = "Login"
        //        };


        //    _loginUserControl = new LoginWindow {DataContext = loginWindowViewModel};
        //    loginWindowViewModel.OnWindowClose += CloseLoginDialog;
        //    _loginWindow.Content = _loginUserControl;
        //    _loginWindow.Width = 320;// _loginUserControl.Width;
        //    _loginWindow.Height = 280;// _loginUserControl.Height;
        //    if (parentWindow as Window != null)
        //        _loginWindow.Owner = parentWindow as Window;
        //    _loginWindow.ShowDialog();
        //    return loginWindowViewModel.UserRelam;
        //}

        //private void CloseLoginDialog(object source, EventArgs e)
        //{
        //    _loginWindow.Close();        
        //}

        #region Implementation of IPlugin

        public string Name { get; set; }

        #endregion
    }
}
